Skip to content

Commit

Permalink
Fix startup_ documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Jun 22, 2024
1 parent 21c20d6 commit e0b8019
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion docs/common_io_tasks_copy_directories.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
6 changes: 3 additions & 3 deletions docs/common_io_tasks_enumerate_directories_and_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## Examples: Use the directory_info class
Expand Down Expand Up @@ -88,7 +88,7 @@ public:
}
};
startup_(program);
startup_(program::main);
```

The following example uses the [directory_info::enumerate_files](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1io_1_1directory__info.html#aae6b6e624c5ac50f1f7bb5ec8088114a) method to list all files whose [length](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1io_1_1file__info.html#a7bbc1abbd603c19f70d687770961d195) exceeds 10MB.
Expand Down Expand Up @@ -147,7 +147,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
2 changes: 1 addition & 1 deletion docs/common_io_tasks_open_and_append_to_a_log_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public:
}
};

startup_(program);
startup_(program::main);

// The example creates a file named "log.txt" and writes the following lines to it,
// or appends them to the existing "log.txt" file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public:
}
};

startup_(program);
startup_(program::main);

// The example creates a file named "Test.data" and writes the integers 0 through 10 to it in binary format.
// It then writes the contents of Test.data to the console with each integer on a separate line.
Expand Down
2 changes: 1 addition & 1 deletion docs/common_io_tasks_read_text_from_a_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
2 changes: 1 addition & 1 deletion docs/common_io_tasks_write_a_text_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
6 changes: 3 additions & 3 deletions docs/common_io_tasks_write_text_to_a_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public:
}
};

startup_(program);
startup_(program::main);

// The example creates a file named "write_lines.txt" with the following contents:
// First line
Expand Down Expand Up @@ -72,7 +72,7 @@ public:
}
};
startup_(program);
startup_(program::main);
// The example adds the following line to the contents of "write_lines.txt":
// Fourth Line
Expand Down Expand Up @@ -108,7 +108,7 @@ public:
}
};

startup_(program);
startup_(program::main);

// The example creates a file named "write_file.txt" with the contents:
// First line
Expand Down
4 changes: 2 additions & 2 deletions docs/delegates.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public:
}
};

startup_(math_class);
startup_(math_class::main);

/* Output:
Invoking the delegate using 'multiply_numbers':
Expand Down Expand Up @@ -263,7 +263,7 @@ public:
}
};
startup_(test_sample_class);
startup_(test_sample_class::main);
/* Output:
A message from the instance method.
Expand Down
10 changes: 5 additions & 5 deletions docs/delegates_and_lambdas.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
Expand Down Expand Up @@ -64,7 +64,7 @@ public:
}
};
startup_(program);
startup_(program::main);
```

The following example demonstrates the use of delegates with static method.
Expand Down Expand Up @@ -92,7 +92,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
* The `using reverse = delegate<ustring(const ustring& s)>;` line creates a delegate type of a certain signature, in this case a method that takes a string parameter and then returns a string parameter.
Expand Down Expand Up @@ -131,7 +131,7 @@ public:
}
};
startup_(program);
startup_(program::main);
```

For this simple example, having a method defined outside of the `main` method seems a bit superfluous. c++11 introduced the concept of [lambda expressions](https://en.cppreference.com/w/cpp/language/lambda), which let you create "inline" methods without having to specify any additional type or method.
Expand All @@ -157,7 +157,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
As you can see, the delegate body is just a set of expressions, like any other delegate.
Expand Down
10 changes: 5 additions & 5 deletions docs/ebook_first_programs.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace tutorial {
};
}

startup_(tutorial::simple);
startup_(tutorial::simple::main);
```
This very basic example shows a small window on the screen. The window is centered.
Expand All @@ -37,7 +37,7 @@ start_position(xtd::forms::form_start_position::center_screen);
This method centers the form on the screen, both horizontally and vertically.

```cpp
startup_(tutorial::simple);
startup_(tutorial::simple::main);
```
The code behind ***startup_*** macro can be replaced by :
Expand Down Expand Up @@ -88,7 +88,7 @@ namespace tutorial {
};
}

startup_(tutorial::form_icon);
startup_(tutorial::form_icon::main);
```
In our example we show a small gammasoft icon.
Expand Down Expand Up @@ -139,7 +139,7 @@ namespace tutorial {
};
}

startup_(tutorial::form_button);
startup_(tutorial::form_button::main);
```
```cpp
Expand Down Expand Up @@ -252,7 +252,7 @@ namespace tutorial {
};
}

startup_(tutorial::communicate);
startup_(tutorial::communicate::main);
```
In our example we have two panels. A left and right panel. The left panel has two buttons. The right panel has one label. The buttons change the number displayed in the label. The question is, how do we grab the pointer to the label?
Expand Down
2 changes: 1 addition & 1 deletion docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public:
}
};

startup_(program);
startup_(program::main);
```
## See also
Expand Down
2 changes: 1 addition & 1 deletion docs/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace example {
};
}

startup_(example::form1);
startup_(example::form1::main);
```
### Start position
Expand Down
2 changes: 1 addition & 1 deletion docs/handle_and_raise_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class program {
}
};
startup_(program);
startup_(program::main);
```

## Static and dynamic event handlers
Expand Down
16 changes: 8 additions & 8 deletions docs/main_and_startup.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ Behind this keyword there is a `main` global function that call `main` static me
## startup_ definition

```cpp
#define startup_(main_class) \
#define startup_(main_method) \
auto main(int argc, char* argv[]) -> int {\
try {\
return __startup__::run(main_class::main, argc, argv);\
return __startup__::run(main_method, argc, argv);\
} catch(const std::exception& e) {\
__startup_catch_exception__(e);\
} catch(...) {\
Expand Down Expand Up @@ -87,7 +87,7 @@ namespace examples {
};
}
startup_(examples::program);
startup_(examples::program::main);
```

See [try-block](https://en.cppreference.com/w/cpp/language/try_catch) for more information.
Expand Down Expand Up @@ -115,7 +115,7 @@ namespace examples {
};
}

startup_(examples::program);
startup_(examples::program::main);
```
* Static `main` member function without argument and with int return value.
Expand All @@ -138,7 +138,7 @@ namespace examples {
};
}
startup_(examples::program);
startup_(examples::program::main);
```

* Static `main` member function with string array argument and without return value.
Expand All @@ -163,7 +163,7 @@ namespace examples {
};
}

startup_(examples::program);
startup_(examples::program::main);
```
* Static `main` member function with string array argument and with int return value.
Expand Down Expand Up @@ -210,7 +210,7 @@ namespace examples {
};
}

startup_(examples::program);
startup_(examples::program::main);
```
* Static `main` member function with int and char*[] arguments and with int return value.
Expand All @@ -234,7 +234,7 @@ namespace examples {
};
}
startup_(examples::program);
startup_(examples::program::main);
```

## Windows main definitions
Expand Down
6 changes: 3 additions & 3 deletions docs/raise_and_consume_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace console_application1 {
};
}

startup_(console_application1::program);
startup_(console_application1::program::main);
```
## Example 2
Expand Down Expand Up @@ -139,7 +139,7 @@ namespace console_application1 {
};
}
startup_(console_application1::program);
startup_(console_application1::program::main);
```

## Example 3
Expand Down Expand Up @@ -222,7 +222,7 @@ namespace console_application1 {
};
}

startup_(console_application1::program);
startup_(console_application1::program::main);
```
# See also
Expand Down
2 changes: 1 addition & 1 deletion docs/xtd_forms_explanations.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ private:
label label1;
};

startup_(form1);
startup_(form1::main);

// This example produces the following output display if you launch the application,
// then double-click the button1 and then close the application:
Expand Down
2 changes: 1 addition & 1 deletion src/xtd.core/include/xtd/io/directory.h
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ namespace xtd {
/// }
/// };
///
/// startup_(program);
/// startup_(program::main);
/// ```
/// @remarks This method returns all subdirectories directly under the specified directory that match the specified search pattern. If the specified directory has no subdirectories, or no subdirectories match the search_pattern parameter, this method returns an empty array. Only the top directory is searched.
/// @remarks search_pattern can be a combination of literal and wildcard characters, but it doesn't support regular expressions. The following wildcard specifiers are permitted in search_pattern.
Expand Down

0 comments on commit e0b8019

Please sign in to comment.